<?php
namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Cookie;
use App\Http\Service\IndexService;

class IndexController extends CommentController
{
	private $_index;

	public function __construct()
	{
		$this->_index = IndexService::getInstance();
	}

	public function index(Request $request)
	{
		$serviceData = $this->_index->getServiceData($request);
		$lastData = $this->_index->getLastLoginDetail();
		$level = session('fyback_info')['level'];
		$id = session('fyback_info')['id'];
		
		return view('admin.index.index', ['serviceData'=>$serviceData, 'lastData'=>$lastData, 'level'=>$level, 'id'=>$id]);
	}
}